﻿USE [master]
GO
/****** Object:  Database [DLM]    Script Date: 06/01/2012 13:05:34 ******/
CREATE DATABASE [DLM] ON  PRIMARY 
( NAME = N'DLM', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'DLM_log', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DLM].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DLM] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DLM] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DLM] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DLM] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DLM] SET ARITHABORT OFF
GO
ALTER DATABASE [DLM] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DLM] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DLM] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [DLM] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DLM] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DLM] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DLM] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DLM] SET  DISABLE_BROKER
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DLM] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DLM] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DLM] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DLM] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DLM] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DLM] SET  READ_WRITE
GO
ALTER DATABASE [DLM] SET RECOVERY FULL
GO
ALTER DATABASE [DLM] SET  MULTI_USER
GO
ALTER DATABASE [DLM] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DLM] SET DB_CHAINING OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'DLM', N'ON'
GO
USE [DLM]
GO
/****** Object:  Table [dbo].[AdminUser]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminUser](
	[AdminID] [int] IDENTITY(1,1) NOT NULL,
	[Administrator] [nvarchar](30) NOT NULL,
	[Password] [varchar](20) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_AdminUser] PRIMARY KEY CLUSTERED 
(
	[AdminID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[AdminLog]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Action] [nvarchar](20) NOT NULL,
	[ActionDate] [datetime] NOT NULL,
	[ActionSourceIP] [varchar](20) NULL,
 CONSTRAINT [PK_AdminLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Account]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Account](
	[AccountID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Password] [varchar](30) NOT NULL,
	[Email] [varchar](30) NOT NULL,
	[ActiveCode] [varchar](50) NOT NULL,
	[IsActive] [bit] NOT NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Account] ON
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (1, N'ww', N'bs5P1RvBE5QmkmN9nUuGDg==', N'oyjd614@gmail.com', N'd9317157-742b-4d5d-bec5-d0f8723c141c', 1, 1, CAST(0x0000A0570112444E AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (2, N'ccx', N'/q0FLu7c+zHEmxn5Ht3tJA==', N'oyjd614@gmail.com', N'83ba74bf-abc8-4853-b3bf-28bd558142fb', 0, 0, CAST(0x0000A05701266639 AS DateTime))
SET IDENTITY_INSERT [dbo].[Account] OFF
/****** Object:  Table [dbo].[EmailInvitation]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EmailInvitation](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[UserID] [int] NOT NULL,
	[Email] [varchar](25) NOT NULL,
	[Content] [ntext] NULL,
	[PartyID] [int] NOT NULL,
	[PartySubject] [nvarchar](30) NULL,
	[IsSent] [bit] NOT NULL,
	[SendDate] [datetime] NOT NULL,
 CONSTRAINT [PK_EmailInvitation] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Country]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Country](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Country] [nvarchar](15) NULL,
	[Province] [nvarchar](15) NULL,
	[City] [nvarchar](10) NULL,
	[Zone] [nvarchar](10) NULL,
	[Town] [nvarchar](30) NULL,
	[ParentId] [int] NULL,
 CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BonusRule]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusRule](
	[RuleID] [int] IDENTITY(1,1) NOT NULL,
	[TemporaryDistrain] [decimal](10, 2) NULL,
	[Distrain] [decimal](10, 2) NULL,
	[Drop] [decimal](10, 2) NULL,
	[Rate] [decimal](10, 2) NULL,
	[Publish] [decimal](10, 2) NULL,
	[Inviite] [decimal](10, 2) NULL,
 CONSTRAINT [PK_BonusRule] PRIMARY KEY CLUSTERED 
(
	[RuleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[BonusRule] ON
INSERT [dbo].[BonusRule] ([RuleID], [TemporaryDistrain], [Distrain], [Drop], [Rate], [Publish], [Inviite]) VALUES (1, CAST(15.00 AS Decimal(10, 2)), CAST(4.00 AS Decimal(10, 2)), CAST(6.00 AS Decimal(10, 2)), CAST(1.00 AS Decimal(10, 2)), CAST(1.00 AS Decimal(10, 2)), CAST(2.00 AS Decimal(10, 2)))
SET IDENTITY_INSERT [dbo].[BonusRule] OFF
/****** Object:  Table [dbo].[BonusLog]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NULL,
	[Bonus] [decimal](10, 2) NULL,
	[CreateDate] [datetime] NULL,
 CONSTRAINT [PK_BonusLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[BonusLog] ON
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (1, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200BDE515 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (2, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200C261E7 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (3, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200E682E3 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (4, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200E7D5B5 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (5, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200E893A0 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (6, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200E8D36F AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (7, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200E92C9C AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (8, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200E94A91 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (9, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200E9AED2 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (10, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200E9C1C2 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (11, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200F5AEDE AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (12, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200F5CD5C AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (13, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06200F65E91 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (14, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A06200F6AA5C AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (15, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A06201152C0B AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (16, 2, 2, CAST(-6.00 AS Decimal(10, 2)), CAST(0x0000A0620115C1E4 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [CreateDate]) VALUES (17, 2, 2, CAST(-15.00 AS Decimal(10, 2)), CAST(0x0000A062011620FD AS DateTime))
SET IDENTITY_INSERT [dbo].[BonusLog] OFF
/****** Object:  Table [dbo].[Party]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Party](
	[PartyID] [int] IDENTITY(1,1) NOT NULL,
	[Status] [int] NOT NULL,
	[PartyType] [int] NOT NULL,
	[Subject] [nvarchar](30) NOT NULL,
	[Content] [ntext] NULL,
	[PhotoUrl] [nvarchar](20) NULL,
	[Modality] [nvarchar](20) NULL,
	[PartyDate] [datetime] NULL,
	[Location] [nvarchar](100) NULL,
	[Address] [nvarchar](150) NULL,
	[Area] [nvarchar](50) NULL,
	[CreateDate] [datetime] NOT NULL,
	[MemberCount] [int] NULL,
	[IsSuccess] [bit] NOT NULL,
 CONSTRAINT [PK_Party] PRIMARY KEY CLUSTERED 
(
	[PartyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Party] ON
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [IsSuccess]) VALUES (1, 0, 1, N'dfdf', NULL, N'ww/09274596.jpg', NULL, NULL, N'22', N'22', NULL, CAST(0x0000A0570116DC20 AS DateTime), 22, 0)
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [CreateDate], [MemberCount], [IsSuccess]) VALUES (2, 0, 0, N'dfdf', NULL, N'ww/09275046.jpg', NULL, CAST(0x0000A05800000000 AS DateTime), N'22', N'22', NULL, CAST(0x0000A0570118157A AS DateTime), 22, 0)
SET IDENTITY_INSERT [dbo].[Party] OFF
/****** Object:  Table [dbo].[Notice]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Notice](
	[NoticeID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Notice] PRIMARY KEY CLUSTERED 
(
	[NoticeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Log]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Level] [varchar](50) NULL,
	[Logger] [varchar](255) NULL,
	[Source] [nvarchar](255) NULL,
	[Message] [nvarchar](255) NULL,
 CONSTRAINT [PK_SystemLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Remark]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Remark](
	[RemarkID] [int] IDENTITY(1,1) NOT NULL,
	[PartyID] [int] NOT NULL,
	[UserID] [int] NOT NULL,
	[Content] [nvarchar](100) NULL,
	[Rate] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Remark] PRIMARY KEY CLUSTERED 
(
	[RemarkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[User]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[AccountID] [int] NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Name] [nvarchar](20) NULL,
	[Gender] [bit] NULL,
	[Birthday] [datetime] NULL,
	[Age] [smallint] NULL,
	[Location] [nvarchar](20) NULL,
	[HomePlace] [nvarchar](30) NULL,
	[Marriage] [bit] NULL,
	[NativePlace] [nvarchar](40) NULL,
	[Stature] [nvarchar](10) NULL,
	[Weight] [int] NULL,
	[Education] [nvarchar](10) NULL,
	[Job] [nvarchar](20) NULL,
	[Income] [decimal](10, 2) NULL,
	[Position] [nvarchar](20) NULL,
	[Industry] [nvarchar](50) NULL,
	[Car] [bit] NULL,
	[Parents] [nvarchar](20) NULL,
	[Photo] [nvarchar](50) NULL,
	[Phone] [varchar](15) NULL,
	[IM] [varchar](18) NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_User_AccountID] UNIQUE NONCLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[User] ON
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (1, 1, N'ww', N'ww', 0, CAST(0x0000798800000000 AS DateTime), NULL, N'shanghai', NULL, 0, N'wlmq', N'170', 60, N'22', N'22', CAST(22.00 AS Decimal(10, 2)), N'22', N'22', NULL, N'1', N'91.jpg', N'22', N'22', 1, CAST(0x0000A0570112444F AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [IsValidation], [CreateDate]) VALUES (2, 2, N'ccx', NULL, 0, CAST(0x0000798500000000 AS DateTime), 28, N'22', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'91.jpg', NULL, NULL, 0, CAST(0x0000A05701266639 AS DateTime))
SET IDENTITY_INSERT [dbo].[User] OFF
/****** Object:  Table [dbo].[UserView]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserView](
	[ViewID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[IP] [varchar](20) NULL,
	[ViewDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserView] PRIMARY KEY CLUSTERED 
(
	[ViewID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[UserPartyAssociation]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserPartyAssociation](
	[UPAID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsLead] [bigint] NULL,
	[AssociationDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserPartyAssociation] PRIMARY KEY CLUSTERED 
(
	[UPAID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] ON
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (2, 1, 2, 1, CAST(0x0000A0570118157F AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (11, 2, 2, 0, CAST(0x0000A0620116196C AS DateTime))
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] OFF
/****** Object:  Table [dbo].[Photo]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Photo](
	[PhotoID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Url] [nvarchar](30) NULL,
	[Desc] [nvarchar](20) NULL,
	[IsMain] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Photo] ON
INSERT [dbo].[Photo] ([PhotoID], [UserID], [Url], [Desc], [IsMain], [CreateDate]) VALUES (1, 1, N'646.jpg', N'', 0, CAST(0x0000A05E012BDE0C AS DateTime))
SET IDENTITY_INSERT [dbo].[Photo] OFF
/****** Object:  Table [dbo].[Invitation]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Invitation](
	[InvitationID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[SenderID] [int] NOT NULL,
	[SenderAccount] [nvarchar](25) NOT NULL,
	[InviteDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Invitation] PRIMARY KEY CLUSTERED 
(
	[InvitationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Friend]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Friend](
	[FriendID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[MyFriendID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
 CONSTRAINT [PK_Friend] PRIMARY KEY CLUSTERED 
(
	[FriendID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Friend] ON
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (1, 1, 2, CAST(0x0000A06200BEBB9C AS DateTime), 0)
SET IDENTITY_INSERT [dbo].[Friend] OFF
/****** Object:  Table [dbo].[Message]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Title] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[IsRead] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED 
(
	[MessageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Bonus]    Script Date: 06/01/2012 13:05:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Bonus](
	[BonusID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Bonus] [decimal](10, 2) NULL,
	[UpdateDate] [datetime] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Bonus] PRIMARY KEY CLUSTERED 
(
	[BonusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_Bonus_UserID] UNIQUE NONCLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Bonus] ON
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (1, 1, CAST(200.00 AS Decimal(10, 2)), CAST(0x0000A06201485290 AS DateTime), CAST(0x0000A0570112454F AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (2, 2, CAST(-133.00 AS Decimal(10, 2)), CAST(0x0000A06201161F07 AS DateTime), CAST(0x0000A057012666F1 AS DateTime))
SET IDENTITY_INSERT [dbo].[Bonus] OFF
/****** Object:  ForeignKey [FK_User_Account]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[User]  WITH CHECK ADD  CONSTRAINT [FK_User_Account] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[User] CHECK CONSTRAINT [FK_User_Account]
GO
/****** Object:  ForeignKey [FK_UserView_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[UserView]  WITH CHECK ADD  CONSTRAINT [FK_UserView_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserView] CHECK CONSTRAINT [FK_UserView_User]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_Party]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_Party] FOREIGN KEY([PartyID])
REFERENCES [dbo].[Party] ([PartyID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_Party]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_User]
GO
/****** Object:  ForeignKey [FK_Photo_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[Photo]  WITH CHECK ADD  CONSTRAINT [FK_Photo_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Photo] CHECK CONSTRAINT [FK_Photo_User]
GO
/****** Object:  ForeignKey [FK_Invitation_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[Invitation]  WITH CHECK ADD  CONSTRAINT [FK_Invitation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Invitation] CHECK CONSTRAINT [FK_Invitation_User]
GO
/****** Object:  ForeignKey [FK_Friend_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[Friend]  WITH CHECK ADD  CONSTRAINT [FK_Friend_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Friend] CHECK CONSTRAINT [FK_Friend_User]
GO
/****** Object:  ForeignKey [FK_Message_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[Message]  WITH CHECK ADD  CONSTRAINT [FK_Message_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Message] CHECK CONSTRAINT [FK_Message_User]
GO
/****** Object:  ForeignKey [FK_Bonus_User]    Script Date: 06/01/2012 13:05:36 ******/
ALTER TABLE [dbo].[Bonus]  WITH CHECK ADD  CONSTRAINT [FK_Bonus_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Bonus] CHECK CONSTRAINT [FK_Bonus_User]
GO
